<template>
    <div>
       
        <div class="mui-numbox" data-numbox-min='1'>
             <!-- "-"按钮，点击可减小当前数值 -->
            <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
            <input class="mui-numbox-input" type="number" value="1" @change="carNum"/>
            <!-- "+"按钮，点击可增大当前数值 -->
            <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
        </div>
    </div>
</template>
<script>
    import mui from "../../../static/mui/js/mui.js"
    export default{
        name:"Numberbox",
        mounted(){
            mui("mui-numbox").numbox()
            mui(".mui-numbox").numbox().setOption("min", 1)
        },
        methods:{
            carNum(){
                // 子传父  组件 把购买value传递给 全局组件
                this.$emit("getNumber", mui(".mui-numbox").numbox().getValue())
                // console.log( mui(".mui-numbox").numbox().getValue() )
            }
        }
    }
</script>
<style>

</style>